package com.kenyi.co.ui.me.adapter;

import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.kenyi.co.R;
import com.kenyi.co.ui.me.bean.UserFavBean;
import com.kenyi.co.utils.ListBaseAdapter;
import com.kenyi.co.utils.SharepUtils;
import com.kenyi.co.utils.StringUtils;
import com.kenyi.co.utils.SuperViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2018/1/29.
 */

public class MainFavAdapter extends ListBaseAdapter<UserFavBean.DatasBean> {

    public MainFavAdapter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_me_main_fav_item;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        UserFavBean.DatasBean item = mDataList.get(position);
        TextView tv_me_main_fav = holder.getView(R.id.tv_me_main_fav);
        RelativeLayout re_me_main_fav = holder.getView(R.id.re_me_main_fav);
        tv_me_main_fav.setText(item.getName());



        if (item.isSelected()) {
            tv_me_main_fav.setTextColor(mContext.getResources().getColor(R.color.main_text_FF8B00));
            re_me_main_fav.setBackground(mContext.getResources().getDrawable(R.drawable.background_bg_banyuan_fff3d8));
        } else {
            tv_me_main_fav.setTextColor(mContext.getResources().getColor(R.color.main_text_333333));
            re_me_main_fav.setBackground(mContext.getResources().getDrawable(R.drawable.background_bg_banyuan_f4f4f4));
        }
    }


}
